package com.yanqu.road.server.cmd.activity.huashigang;

import com.yanqu.road.entity.player.UserBaseInfo;
import com.yanqu.road.logic.pb.PlayerBasePb;
import com.yanqu.road.pb.huashigang.HuaShiGangProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.cross.battle.HuaShiGangMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.CrossProtocol;

/**
 * @Author wpj
 * @Date 2020/10/7
 */
@Cmd(code = CrossProtocol.C2_HUA_SHI_GANG_ATTACK_MONSTER, desc = "花石纲攻击怪物")
public class CrossAttackMonsterCmd extends CrossCommand {

    int activityId;
    int patronsId;
    long ability;
    UserBaseInfo userBaseInfo;
    int costNum;
    int talentAddition;
    int occupationAddition;
    int bossTalentAddition;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        HuaShiGangProto.CrossAttackMonsterReqMsg msg = HuaShiGangProto.CrossAttackMonsterReqMsg.parseFrom(packet.getBytes());
        activityId = msg.getActivityId();
        patronsId = msg.getPatronsId();
        ability = msg.getAbility();
        userBaseInfo = PlayerBasePb.parseToUserBaseInfo(msg.getPlayerInfo());
        costNum = msg.getCostNum();
        talentAddition = msg.getTalentAddition();
        occupationAddition = msg.getOccupationAddition();
        bossTalentAddition = msg.getBossTalentAddition();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        HuaShiGangMgr.attackMonster(activityId, serverId, packet.getPlayerId(), patronsId, ability, userBaseInfo, costNum, talentAddition, occupationAddition, bossTalentAddition);
    }

    @Override
    public void sendData() {

    }


}
